package com.smile.service.entity.organization;

import com.alibaba.fastjson2.annotation.JSONField;

public class AirportOrganizationResult {

    @JSONField(name = "output")
    private OrganizationOutput output;

    @JSONField(name = "result")
    private int resultCode;

    // 嵌套类 - 组织信息输出
    public static class OrganizationOutput {
        @JSONField(name = "organization_name")
        private String organizationName;

        // Getter & Setter
        public String getOrganizationName() {
            return organizationName;
        }

        public void setOrganizationName(String organizationName) {
            this.organizationName = organizationName;
        }

        @Override
        public String toString() {
            return "OrganizationOutput{" +
                    "organizationName='" + organizationName + '\'' +
                    '}';
        }
    }

    // Getters & Setters
    public OrganizationOutput getOutput() {
        return output;
    }

    public void setOutput(OrganizationOutput output) {
        this.output = output;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    // 实用方法 - 判断操作是否成功 (0通常表示成功)
//    public boolean isSuccess() {
//        return resultCode == 0;
//    }

    // 实用方法 - 获取组织名称（简化访问）
    public String getOrganizationName() {
        return output != null ? output.getOrganizationName() : null;
    }

    // 实用方法 - 检查是否有组织信息
//    public boolean hasOrganizationInfo() {
//        return output != null &&
//                output.getOrganizationName() != null &&
//                !output.getOrganizationName().isEmpty();
//    }

    @Override
    public String toString() {
        return "AirportOrganizationResult{" +
                "output=" + output +
                ", resultCode=" + resultCode +
                '}';
    }
}
